package com.sanhuo.triild.Basic;


import com.sanhuo.triild.annotation.DeleteProvider;
import com.sanhuo.triild.annotation.InsertProvider;
import com.sanhuo.triild.annotation.SelectProvider;
import com.sanhuo.triild.annotation.UpdateProvider;
import com.sanhuo.triild.page.Page;
import com.sanhuo.triild.page.PageSearch;
import com.sanhuo.triild.provider.BaseProvider;

import java.util.List;

public interface BaseMapper<T> {

    @SelectProvider(type = BaseProvider.class, method = "findById")
    T findById(String id);

    @SelectProvider(type = BaseProvider.class, method = "findAll")
    List<T> findAll();

    @SelectProvider(type = BaseProvider.class, method = "findAll")
    Page<T> listAll(PageSearch pageSearch);

    @InsertProvider(type = BaseProvider.class, method = "save")
    void save(T entity);

    @UpdateProvider(type = BaseProvider.class, method = "update")
    void update(T entity);

    @DeleteProvider(type = BaseProvider.class,method = "remove")
    void remove(String id);

    

}
